const wx2my = require('../../../wx2my');
const Behavior = require('../../../Behavior');
var app = getApp();
Page({
  data: {
    page: 1,
    score_detail: []
  },
  onLoad: function (e) {
    wx2my.setNavigationBarColor({
      frontColor: '#000000',
      backgroundColor: '#ffffff'
    }), this.setData({
      seller_id: e.seller_id
    }), this.refresh();
  },
  refresh: function (e) {
    var a = this,
        o = a.data.score_detail,
        t = a.data.seller_id,
        n = a.data.page;
    app.util.request({
      url: "entry/wxapp/SellerTxList",
      data: {
        seller_id: t
      },
      success: function (e) {
        if (console.log(e), 0 < e.data.length) {
          for (var t in o = o.concat(e.data), e.data) e.data[t].time = e.data[t].time.slice(0, 16);

          a.setData({
            page: n + 1,
            score_detail: o
          });
        }
      }
    });
  },
  onReady: function () {},
  onShow: function () {},
  onHide: function () {},
  onUnload: function () {},
  onPullDownRefresh: function () {
    this.setData({
      score_detail: [],
      page: 1
    }), this.refresh(), wx2my.stopPullDownRefresh();
  },
  onReachBottom: function () {
    this.refresh();
  }
});